package com.wct.springcloud.service;

import com.wct.springcloud.model.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author WEI (Email:changtan20000@163.com)
 * @description
 * @date: 2019/12/18 14:35
 */
@FeignClient(value = "MICROSERVICECLOUD-DEPT-PROVIDER", fallbackFactory = DeptClientServiceFallbackFactory.class)
//@FeignClient(value = "MICROSERVICECLOUD-DEPT-PROVIDER")
public interface DeptClientService {
    @PostMapping("/dept/add")
    boolean add(@RequestBody Dept dept);

    @GetMapping("/dept/get/{deptno}")
    Dept get(@PathVariable("deptno") Integer deptno);

    @GetMapping("/dept/list")
    List<Dept> list();

    @PostMapping("/dept/update")
    int update(@RequestBody Dept record);

    @DeleteMapping("/dept/{deptno}")
    int delete(@PathVariable("deptno") Integer deptno);
}
